# 基础镜像
FROM registry.cn-beijing.aliyuncs.com/prohuiliu/jdk:1.8.4

VOLUME /data

# 获取pom文件中build参数
ADD ./target/cloud-xxljob-3.0.jar ./data/app/xxljob.jar
ADD ./src/main/resources/ ./data/app/config/

ENV ENABLE_PINPOINT=false
ENV PINPOIN_COLLECTOR=123.57.253.228
ENV APP_NAME=xxljob

ENV ENABLE_SK=false
ENV SK_COLLECTOR=123.57.253.228:11800


ENV ENABLE_CMD=false
ENV MAINCLASS=com.xxl.job.admin.XxlJobAdminApplication
ENV CLASSPATH=/data/app/lib/*:/data/app/config

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LC_ALL "zh_CN.UTF-8"

ENV APP_JAR=xxljob
ENV JAVA_OPTS="-Xms512m -Xmx512m -Dspring.profiles.active=dev"

RUN cd /usr/local/jdk1.8/jre/lib/security/policy/limited && rm -rf * && cp /usr/local/jdk1.8/jre/lib/security/policy/unlimited/* .
WORKDIR /data/app/

CMD ["/tmp/setenv.sh"," java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /data/app/$APP_JAR.jar "]
